// image service
QUnit.test('test image resizing with defined height', assert => {
  var done = assert.async()

  App.ImageService.resize(image_40x30, 'auto', 15, 1, 'image/png', 0.7, function(image, width, height) {
    assert.equal(width, 20)

    done()
  })
});

QUnit.test('test image resizing with a GIF', assert => {
  var done = assert.async()

  App.ImageService.resize(image_gif, 12, 12, 1, 'image/gif', 1, function(dataURI, width, height) {
    assert.ok(dataURI.startsWith('data:image/png;base64,'), 'resized into PNG')
    assert.equal(height, 12, 'resized height')
    assert.equal(width, 12, 'resized width')

    done()
  })
});

QUnit.test('test no image resizing with a GIF', assert => {
  var done = assert.async()

  App.ImageService.resize(image_gif, 1200, 'auto', 1, 'image/gif', 1, function(dataURI, width, height) {
    assert.equal(dataURI, image_gif, 'original data URI')
    assert.equal(height, 16, 'original height')
    assert.equal(width, 16, 'original width')

    done()
  })
});

var image_40x30 = ''

var image_gif = ''
